package top.lixunda.commerce.common.core.controller.wrapper;

import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import java.util.List;
import java.util.Map;

/**
 * @author LiXunda
 * @version time:2019/10/14 9:49
 */
@SuppressWarnings("unused")
@EqualsAndHashCode(callSuper = true)
@Slf4j
public class UpdateSqlWrapper<T> extends AbstractSqlWrapper<T> implements IUpdateSqlWrapper<T> {

    private UpdateEntityBlock<T> entityBlock = new UpdateEntityBlock<>();

    @Override
    public IUpdateSqlWrapper<T> set(String column, Object value) {
        entityBlock.set(column, value);
        return this;
    }

    @Override
    public IUpdateSqlWrapper<T> updateAll() {
        entityBlock.updateAll();
        return this;
    }

    @Override
    public IUpdateSqlWrapper<T> updateNotNull() {
        entityBlock.updateNotNull();
        return this;
    }

    public void setEntityBlock(UpdateEntityBlock<T> entityBlock) {
        this.entityBlock = entityBlock;
    }

    @Override
    public UpdateEntityBlock<T> getEntityBlock() {
        return entityBlock;
    }

    @Override
    public BaseDataUpdateSqlWrapper toDataUpdateSqlWrapper() {
        return (BaseDataUpdateSqlWrapper) BaseDataSqlWrapper.fromWrapper(this, new BaseDataUpdateSqlWrapper<>());
    }

    @Override
    public ConditionBlock getConditionBlock() {
        return super.getConditionBlock();
    }

    @Override
    public ConditionBlock getNow() {
        return super.getNow();
    }

    @Override
    public OtherBlock getOtherBlock() {
        return super.getOtherBlock();
    }

    @Override
    public String toString() {
        return super.toString();
    }

    @Override
    public IUpdateSqlWrapper<T> groupBy(String... column) {
        return (UpdateSqlWrapper<T>) super.groupBy(column);
    }

    @Override
    public IUpdateSqlWrapper<T> orderBy(Map<String, String> map) {
        return (UpdateSqlWrapper<T>) super.orderBy(map);
    }

    @Override
    public IUpdateSqlWrapper<T> orderBy(String column, String value) {
        return (UpdateSqlWrapper<T>) super.orderBy(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> orderByAsc(String... columns) {
        return (UpdateSqlWrapper<T>) super.orderByAsc(columns);
    }

    @Override
    public IUpdateSqlWrapper<T> orderByDesc(String... columns) {
        return (UpdateSqlWrapper<T>) super.orderByDesc(columns);
    }

    @Override
    public IUpdateSqlWrapper<T> having(String column) {
        return (UpdateSqlWrapper<T>) super.having(column);
    }

    @Override
    public IUpdateSqlWrapper<T> limit(int start, int count) {
        return (UpdateSqlWrapper<T>) super.limit(start, count);
    }

    @Override
    public IUpdateSqlWrapper<T> allEq(Map<String, Object> map) {
        return (UpdateSqlWrapper<T>) super.allEq(map);
    }

    @Override
    public IUpdateSqlWrapper<T> eq(String column, Object value) {
        return (UpdateSqlWrapper<T>) super.eq(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> ne(String column, Object value) {
        return (UpdateSqlWrapper<T>) super.ne(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> gt(String column, Object value) {
        return (UpdateSqlWrapper<T>) super.gt(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> ge(String column, Object value) {
        return (UpdateSqlWrapper<T>) super.ge(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> lt(String column, Object value) {
        return (UpdateSqlWrapper<T>) super.lt(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> le(String column, Object value) {
        return (UpdateSqlWrapper<T>) super.le(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> between(String column, Object value1, Object value2) {
        return (UpdateSqlWrapper<T>) super.between(column, value1, value2);
    }

    @Override
    public IUpdateSqlWrapper<T> notBetween(String column, Object value1, Object value2) {
        return (UpdateSqlWrapper<T>) super.notBetween(column, value1, value2);
    }

    @Override
    public IUpdateSqlWrapper<T> like(String column, String value) {
        return (UpdateSqlWrapper<T>) super.like(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> notLike(String column, String value) {
        return (UpdateSqlWrapper<T>) super.notLike(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> likeLeft(String column, String value) {
        return (UpdateSqlWrapper<T>) super.likeLeft(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> likeRight(String column, String value) {
        return (UpdateSqlWrapper<T>) super.likeRight(column, value);
    }

    @Override
    public IUpdateSqlWrapper<T> isNull(String... column) {
        return (UpdateSqlWrapper<T>) super.isNull(column);
    }

    @Override
    public IUpdateSqlWrapper<T> isNotNull(String... column) {
        return (UpdateSqlWrapper<T>) super.isNotNull(column);
    }

    @Override
    public IUpdateSqlWrapper<T> in(String column, List<?> values) {
        return (UpdateSqlWrapper<T>) super.in(column, values);
    }

    @Override
    public IUpdateSqlWrapper<T> notIn(String column, List<?> values) {
        return (UpdateSqlWrapper<T>) super.notIn(column, values);
    }

    @Override
    public IUpdateSqlWrapper<T> or() {
        return (UpdateSqlWrapper<T>) super.or();
    }

    @Override
    public IUpdateSqlWrapper<T> and() {
        return (UpdateSqlWrapper<T>) super.and();
    }

    @Override
    public IUpdateSqlWrapper<T> or(ConditionBlock sqlBlock) {
        return (UpdateSqlWrapper<T>) super.or(sqlBlock);
    }

    @Override
    public IUpdateSqlWrapper<T> and(ConditionBlock sqlBlock) {
        return (UpdateSqlWrapper<T>) super.and(sqlBlock);
    }

    @Override
    public T getEntity() {
        return super.getEntity();
    }

    @Override
    public IUpdateSqlWrapper<T> setEntity(T t) {
        return (UpdateSqlWrapper<T>) super.setEntity(t);
    }
}
